package com.jintian.smart.kernel.switching.fn;

import com.jintian.smart.kernel.core.annotation.beetl.BeetlFunction;
import org.beetl.core.Context;
import org.beetl.core.Function;

@BeetlFunction(code = "split")
public class Split implements Function {
    @Override
    public Object call(Object[] paras, Context ctx) {
        if (paras.length > 1) {
            return paras[0].toString().split(paras[1].toString());
        }
        return paras[0].toString().split(",");
    }
}
